package com.into.common.csv.converters;

import com.into.common.csv.converters.appenders.ValueAppenderConverter;

public class StringAppenderConverter extends ValueAppenderConverter<String> {
	protected String	separator;

	public StringAppenderConverter(String separator) {
		this.separator = separator;
	}

	@Override
	public String fromString(String value) throws Exception {
		return value;
	}

	@Override
	public String toString(String value) throws Exception {
		return value;
	}

	@Override
	protected String append(String originalValue, String value) {
		return originalValue != null ? originalValue + separator + value : value;
	}

	public String getSeparator() {
		return separator;
	}

	public void setSeparator(String separator) {
		this.separator = separator;
	}

}
